package com.caishi.lkx.user.service;


import com.zzw.common.entity.BSService;
import com.caishi.lkx.user.model.re.UserGroupReModel;
import com.caishi.lkx.user.ienum.status.UserGroupStatus;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.concurrent.TimeoutException;

/**
* @Param:
* @return
* @Author: huangpeng
* @Date: 2022/1/6 15:09
* @Description:
*/
public interface IUserGroupReService extends BSService<UserGroupReModel,Long> {

    /**
    * @Param: [currentUserId, currentIp, longitude, latitude]
    * @return com.caishi.lkx.user.model.re.UserGroupReModel
    * @Author: huangpeng
    * @Date: 2022/2/9 16:20
    * @Description: 用户绑定机构    可以重复绑定   如果绑定机构id和当前机构ID一致(直接审核通过)
    */
    Boolean bind(Long groupId,String currentUserId, String currentIp, BigDecimal longitude, BigDecimal latitude) throws InterruptedException, TimeoutException;

    /**
    * @Param: [groupId, currentIp, longitude, latitude]
    * @return boolean
    * @Author: huangpeng
    * @Date: 2022/2/9 16:33
    * @Description: 判断用户绑定机构是否处于当前ip/经纬度下
    */
    boolean checkUserBindGroup(Long groupId, String currentIp, BigDecimal longitude, BigDecimal latitude) ;

    Boolean unBind(String currentUserId) throws InterruptedException, TimeoutException;

    /**
    * @Param: [userId]
    * @return com.caishi.lkx.user.model.re.UserGroupReModel
    * @Author: huangpeng
    * @Date: 2022/2/9 16:55
    * @Description: 查询当前用户绑定的机构
    */
    UserGroupReModel currentUserGroup(String userId);

    Boolean changeStatus(List<Long> ids, UserGroupStatus status);

    Boolean updateExpireDate(String currentUserId, LocalDate newDate, Integer days);
}
